Repository navigation
feat(memory): keep per-field semanticScore in memory search results - #1991
Merged
Merged
Conversation
LLMOps passes ECS's per-field semanticScore through on memory search, but MemoryMatchField did not declare it and pydantic's default extra="ignore" dropped it. Callers and the agent's "Apply dynamic few shot" span saw only the rank-scale field score. Add semantic_score (optional) to MemoryMatchField and let the search response models keep unknown keys, so new server fields are no longer silently discarded. Bump uipath-platform to 0.3.7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the changes exposing per-field semantic scores in memory search results.
No open issues 🎉
What changed in this PR
This PR preserves per-field semantic similarity in the platform SDK’s memory search results, making it available to callers and serialized traces without breaking older responses.
Changes:
- Adds optional
semantic_score, aliased tosemanticScore, and preserves unknown server keys in search response models. - Adds tests for parsing, serialization, optional values, and unknown-key retention.
- Bumps
uipath-platformto version0.3.7and updates both lockfiles.
| File | Description |
|---|---|
packages/uipath/uv.lock |
Updates the local platform dependency version to 0.3.7. |
packages/uipath-platform/uv.lock |
Aligns the platform lockfile with version 0.3.7. |
packages/uipath-platform/tests/services/test_memory_service.py |
Tests semantic score preservation and response compatibility. |
packages/uipath-platform/src/uipath/platform/memory/memory.py |
Adds the semantic score field and retains unknown search response keys. |
packages/uipath-platform/pyproject.toml |
Bumps the platform package version to 0.3.7. |
Review effort: Balanced
…nknown keys Drop extra="allow" from the search response models. Unknown keys would flow into the agent's "Apply dynamic few shot" span and the SDK's memory_search span without review, so new server fields should be added deliberately, as semantic_score is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
preston-bao
approved these changes
Nov 12, 2026
|
JosephMar
approved these changes
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Memory search results lost each field's semantic similarity. ECS returns
fields[].semanticScoreand LLMOps passes it through (QueryMemorySearchHandlermapsSemanticScore = f.SemanticScoreinto itsFieldmodel). ButMemoryMatchFielddidn't declare it, and pydantic's defaultextra="ignore"dropped it. Callers, and the agent'sApply dynamic few shotspan (which writesresponse.model_dump(...)), only saw the per-fieldscore. In Hybrid mode that value looks like reciprocal-rank fusion (for example exactly1/61), not a similarity. As a result, a trace couldn't show how close a field actually was.This change:
semantic_score: Optional[float](aliassemanticScore) toMemoryMatchField; it's optional so older responses still parseThe models still ignore unknown keys. That's deliberate: kept keys would be written to the
Apply dynamic few shotspan and the SDK'smemory_searchspan, so new server fields should be added explicitly, as this one is. Escalation memory models are unchanged.Tests: the sample search response now carries a field-level
semanticScore. New tests cover parsing it, keeping it in aby_aliasdump, and it being optional.Follow-up: uipath-langchain needs no runtime change, because the span picks the field up automatically. Once this publishes, it gets a test pinning
semanticScoreon the span and a bump touipath-platform>=0.3.7. Locally that test fails against 0.3.6 and passes against this branch.🤖 Generated with Claude Code